home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / ruthie / ruthie.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  7.1 KB  |  223 lines

  1. VERSION 2.00
  2. Begin Form Ruthie 
  3.    Caption         =   "RuthieWare"
  4.    ClientHeight    =   3840
  5.    ClientLeft      =   4020
  6.    ClientTop       =   750
  7.    ClientWidth     =   9090
  8.    Height          =   4530
  9.    Icon            =   RUTHIE.FRX:0000
  10.    Left            =   3960
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form2"
  13.    ScaleHeight     =   3840
  14.    ScaleWidth      =   9090
  15.    Top             =   120
  16.    Width           =   9210
  17.    Begin PictureBox Actions 
  18.       AutoRedraw      =   -1  'True
  19.       BorderStyle     =   0  'None
  20.       Height          =   615
  21.       Left            =   8400
  22.       ScaleHeight     =   615
  23.       ScaleWidth      =   1335
  24.       TabIndex        =   3
  25.       Top             =   7080
  26.       Width           =   1335
  27.       Begin PictureBox GoToGame2 
  28.          AutoRedraw      =   -1  'True
  29.          BorderStyle     =   0  'None
  30.          Height          =   495
  31.          Left            =   720
  32.          Picture         =   RUTHIE.FRX:0302
  33.          ScaleHeight     =   495
  34.          ScaleWidth      =   495
  35.          TabIndex        =   5
  36.          Top             =   120
  37.          Width           =   495
  38.       End
  39.       Begin PictureBox Quit 
  40.          AutoRedraw      =   -1  'True
  41.          BorderStyle     =   0  'None
  42.          Height          =   495
  43.          Left            =   0
  44.          Picture         =   RUTHIE.FRX:0604
  45.          ScaleHeight     =   495
  46.          ScaleWidth      =   495
  47.          TabIndex        =   4
  48.          Top             =   120
  49.          Width           =   495
  50.       End
  51.    End
  52.    Begin Timer Timer2 
  53.       Left            =   1320
  54.       Top             =   6960
  55.    End
  56.    Begin Timer Timer1 
  57.       Left            =   720
  58.       Top             =   6960
  59.    End
  60.    Begin PictureBox Background 
  61.       BorderStyle     =   0  'None
  62.       Height          =   2655
  63.       Left            =   9720
  64.       Picture         =   RUTHIE.FRX:0906
  65.       ScaleHeight     =   2655
  66.       ScaleWidth      =   3495
  67.       TabIndex        =   6
  68.       Top             =   360
  69.       Visible         =   0   'False
  70.       Width           =   3495
  71.    End
  72.    Begin PictureBox LiveArea 
  73.       BorderStyle     =   0  'None
  74.       Height          =   6735
  75.       Left            =   360
  76.       ScaleHeight     =   6735
  77.       ScaleWidth      =   9255
  78.       TabIndex        =   0
  79.       Top             =   240
  80.       Width           =   9255
  81.       Begin PictureBox SadFace 
  82.          BorderStyle     =   0  'None
  83.          Height          =   3615
  84.          Left            =   2040
  85.          Picture         =   RUTHIE.FRX:27CE
  86.          ScaleHeight     =   3615
  87.          ScaleWidth      =   3735
  88.          TabIndex        =   2
  89.          Top             =   1440
  90.          Visible         =   0   'False
  91.          Width           =   3735
  92.       End
  93.       Begin PictureBox Picture1 
  94.          BackColor       =   &H000000FF&
  95.          Height          =   1575
  96.          Left            =   1680
  97.          ScaleHeight     =   1545
  98.          ScaleWidth      =   1545
  99.          TabIndex        =   1
  100.          Top             =   720
  101.          Width           =   1575
  102.       End
  103.    End
  104.    Begin Menu File 
  105.       Caption         =   "&File"
  106.       Begin Menu FileAbout 
  107.          Caption         =   "&About Ruthie"
  108.       End
  109.       Begin Menu FileExit 
  110.          Caption         =   "E&xit"
  111.       End
  112.    End
  113.    Begin Menu Game 
  114.       Caption         =   "&Game"
  115.       Begin Menu GameGame1 
  116.          Caption         =   "Game &1"
  117.          Checked         =   -1  'True
  118.       End
  119.       Begin Menu GameGame2 
  120.          Caption         =   "Game &2"
  121.       End
  122.       Begin Menu GameGame3 
  123.          Caption         =   "Game &3"
  124.       End
  125.    End
  126.    Begin Menu Instructions 
  127.       Caption         =   "&Instructions"
  128.       Begin Menu InstructionsGame1 
  129.          Caption         =   "Playing Game &1"
  130.       End
  131.    End
  132. Sub FileAbout_Click ()
  133.     Open2.Show 1
  134. End Sub
  135. Sub FileExit_Click ()
  136.     End
  137. End Sub
  138. Sub Form_Click ()
  139.     SadFace.ScaleWidth = Ruthie.ScaleWidth / 2.5
  140.     SadFace.ScaleHeight = SadFace.ScaleWidth
  141.     SadFace.Left = (Ruthie.ScaleWidth - SadFace.ScaleWidth) / 2  ' Position SadFace, but don't resize it
  142.     SadFace.Top = (Ruthie.ScaleHeight - SadFace.ScaleHeight) / 2
  143.     SadFace.Visible = True
  144.     Timer2.Interval = HowLong
  145. End Sub
  146. Sub Form_Load ()
  147.     Ruthie.Width = Screen.Width * .75           ' Set height of form.
  148.     Ruthie.Height = Screen.Height * .75         ' Set width of form.
  149.     Ruthie.Left = (Screen.Width - Width) / 2    ' Center form horizontally.
  150.     Ruthie.Top = (Screen.Height - Height) / 2   ' Center form vertically.
  151.     Initialize                                  ' Define shapes, sizes, placements
  152. End Sub
  153. Sub Form_Resize ()
  154.     Scale                                   ' Reset scale to twips
  155.     If Ruthie.Height > 100 Then Initialize  ' If the Height is smaller, than it's been
  156.                         ' minimized. We don't want to initialize if
  157.                         ' that's the case.
  158. End Sub
  159. Sub GameGame1_Click ()
  160.      MsgBox "Umm... You're already playing Game 1", 0, Header
  161. End Sub
  162. Sub GameGame2_Click ()
  163.     Ruthie.Hide
  164.     Game2.Show
  165. End Sub
  166. Sub GameGame3_Click ()
  167.     Ruthie.Hide
  168.     Game3.Show
  169. End Sub
  170. Sub GoToGame2_Click ()
  171.     Ruthie.Hide
  172.     Game2.Show
  173. End Sub
  174. Sub Initialize ()
  175.     Ruthie.Scale (0, 0)-(100, 75)               ' Define the scale for the form
  176.     LiveArea.Scale (0, 0)-(100, 75)             ' Define the live area scale
  177.     LiveArea.Width = Ruthie.ScaleWidth          ' Place LiveArea
  178.     LiveArea.Height = Ruthie.ScaleHeight * .7
  179.     LiveArea.Left = (Ruthie.ScaleWidth - LiveArea.Width) / 2
  180.     LiveArea.Top = 5
  181.     Background.Width = Ruthie.ScaleWidth * .8   ' Place Background
  182.     Background.Height = Ruthie.ScaleHeight * .8
  183.     Background.Left = (Ruthie.ScaleWidth - LiveArea.Width) / 2
  184.     Background.Top = (Ruthie.ScaleHeight - LiveArea.Height) / 2
  185.     Picture1.Left = 25
  186.     Picture1.Top = 25
  187.     Actions.Left = 80                           ' Place the action icons (Stop, Game2, etc.)
  188.     Actions.Top = 68
  189.     Actions.Refresh
  190.     Quit.Refresh
  191.     GoToGame2.Refresh
  192.     Randomize                                   ' Reseed the random number generator
  193. End Sub
  194. Sub InstructionsGame1_Click ()
  195.     InstGame1.Show MODAL
  196. End Sub
  197. Sub LiveArea_Click ()
  198.     Form_Click
  199. End Sub
  200. Sub Picture1_Click ()
  201.     Dim WidthFree As Integer, HeightFree As Integer
  202.     Background.Visible = True
  203. '   *** We've beeped, and turned on the picture. Now we
  204. '       want to move the button before we launch the timer.
  205.     WidthFree = LiveArea.ScaleWidth - Picture1.Width
  206.     HeightFree = LiveArea.ScaleHeight - Picture1.Height
  207.     Picture1.Move (Int(WidthFree * Rnd)), (Int(HeightFree * Rnd))
  208. '   *** Now, if that worked, we'll set the timer. When it's done,
  209. '       it will turn the background picture off, and we'll start
  210. '       again.
  211.     Timer1.Interval = HowLong
  212. End Sub
  213. Sub Quit_Click ()
  214.     End
  215. End Sub
  216. Sub Timer1_Timer ()
  217.     Background.Visible = False
  218.     Picture1.Refresh
  219. End Sub
  220. Sub Timer2_Timer ()
  221.     SadFace.Visible = False
  222. End Sub
  223.